package com.hui.stock.service.impl;

import com.hui.stock.mapper.SysPermissionMapper;
import com.hui.stock.pojo.domain.PermissionTreeDomain;
import com.hui.stock.pojo.entity.SysPermission;
import com.hui.stock.service.PermissionService;
import com.hui.stock.vo.resp.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: ymh
 * @date: 2024/12/31 16:12
 * @description:
 */
@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    private SysPermissionMapper sysPermissionMapper;
    @Override
    public R<List<SysPermission>> getAllAvailablePermissions() {
        List<SysPermission> data = sysPermissionMapper.getAllAvailablePermissions();
        return R.ok(data);
    }

    @Override
    public R<List<PermissionTreeDomain>> getPermissionsTree() {
        List<PermissionTreeDomain> list = sysPermissionMapper.getDirectoryAndMenu();
        return R.ok(list);
    }

}
